<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
#macro ( genericTree $somelist ) 
#foreach ( $some in $somelist )
<option value="$!some.id">#if($!some.level>0)
#foreach($count in [0..$!some.level])&nbsp;&nbsp;#end #end $!some.className</option>
#genericTree($some.childs) 
#end 
#end
<link href="$!webPath/resources/style/system/manage/$!{config.websiteCss}/template.css"  rel="stylesheet" type="text/css"/>
<script src="$!webPath/resources/js/jquery-1.8.3.min.js"></script>
<script src="$!webPath/resources/js/jquery.validate.min.js"></script>
<script src="$!webPath/resources/js/jquery.shop.common.js"></script>
<script src="$!webPath/resources/js/jquery.poshytip.min.js"></script>
<script src="$!webPath/resources/js/vue.min.js"></script>
<script charset="utf-8" src="$!webPath/resources/editor/kindeditor.js"></script>
<script charset="utf-8" src="$!webPath/resources/editor/lang/zh_CN.js"></script>
<script>
//options为编辑配置属性
var options = {
        cssPath : '$!webPath/resources/editor/themes/default/default.css',
        filterMode : true,
		uploadJson:'$!webPath/upload.htm',
		width : '700px',
		height:'400px',
		syncType:"form",
		afterCreate : function() {
							var self = this;
							self.sync();
						},
		afterChange : function() {
							var self = this;
							self.sync();
						},
		afterBlur : function() {
							var self = this;
							self.sync();
						},
		items:['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
			'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
			'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
			'superscript', '|', 'selectall', 'clearhtml','quickformat','|',
			'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
			'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'table', 'hr', 'emoticons', 'link', 'unlink', '|', 'about']
};
jQuery(document).ready(function(){
//设置默认状态以及判断初始显示状态
	var state = jQuery("#display").val();
	if(state==""){
		jQuery("#display").val("true");
		jQuery("#displayOff").hide();
	}else{
		 if(state=="true"){
			jQuery("#displayOff").hide();
		}else{
			jQuery("#displayOn").hide();
		}
	}	
//
   jQuery("#theForm").validate({
	ignore: "",						  
    rules:{
      name:{required :true},
	  remarkValue:{required:true}
	 },
	messages:{
	  name:{required:"标签分类名称不能为空"},
	  remarkValue:{required:"标签值列表不能为空"}
	}
  }); 
  //

  editor = KindEditor.create('#content',options); 
  jQuery("#class_id").val("$!obj.articleClass.id");
  //
   jQuery("#display_img").click(function(){
    var display=jQuery("#display").val();
	if(display=="true"){
	  jQuery("#display_img").attr("src","$!webPath/resources/style/system/manage/blue/images/no.jpg");
	  jQuery("#display").val("false");
	}else{
	  jQuery("#display_img").attr("src","$!webPath/resources/style/system/manage/$!{config.websiteCss}/images/yes.jpg");
	  jQuery("#display").val("true");
	}
  }); 
}); 

function saveForm(){
   $("#theForm").submit();
}

</script>
</head>
<body>
<div class="cont" >
  <h1 class="seth1">新增标签</h1>
  <div class="settab"><span class="tab-one"></span> <span class="tabs"> <a href="$!webPath/admin/classify_list.htm">管理</a> | <a href="$!webPath/admin/loadAddSpecialSubject.htm" #if(!$!edit)class="this"#end>新增</a> #if($!edit) <a href="javascript:void(0);" class="this">编辑</a> #end </span> <span class="tab-two"></span></div>
  <form name="theForm" id="theForm" action="$!webPath/admin/addClassify.htm" method="post">
    <div class="setcont">
      <ul class="set1">
          <li><span>标签分类名称：</span><span><input type="text" size="40" name="name"/></span></li>
          <li><span>所属标签属性：</span>
            <span>
	          <select name="classid" id="class_id222">
	            #foreach ($li in $list )
	            <option value=$!li.id>$!li.name</option>
	            #end
	          </select>
            </span></li>
          <li><span>标签值列表：</span><span><input type="text" size="40" name="remarkValue"/></span></li>
      </ul>
    </div>
  </form>
  <div class="submit">
    <input name="" type="button" value="提交" onclick="saveForm()" />
  </div>
</div>
<script>
var vm=new Vue({
    el:"#theForm",
    data:{
    	pink:1
    },
    mounted:function () {
        this.$nextTick(function () {
            this.init();
        })
    },
    filters:{
    	formatMoney(value){
        }
    },
    methods:{
        init:function (){
        },
        formatType:function(v){
            if(v==3){
            	editor = KindEditor.create('#content',options); 
            	//jQuery("#class_id").val("$!obj.articleClass.id");
            }
        }
    }
});	
 </script>
</body>
</html>
